/*
 * @Description:
 * @version:
 * @Author: 尹鹏孝
 * @Date: 2022-12-19 16:19:43
 * @LastEditors: 尹鹏孝
 * @LastEditTime: 2022-12-19 16:39:44
 */
import { onMounted, onUnmounted } from 'vue'
export function useEventListener(target: WindowEventHandlers, event:string , callback: any): void {
    onMounted(() => {
        target.addEventListener(event,callback)
    })
    onUnmounted(() => {
        target.removeEventListener(event,callback)
    })
}